package com.tarena.lbs.business.dao.repository.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tarena.lbs.business.dao.mapper.BusinessMapper;
import com.tarena.lbs.business.dao.repository.BusinessRepository;
import com.tarena.lbs.business.pojo.po.BusinessPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public class BusinessRepositoryImpl implements BusinessRepository {
    @Autowired
    private BusinessMapper businessMapper;
    @Override
    public List<BusinessPO> list(QueryWrapper<BusinessPO> queryWrapper) {
        return businessMapper.selectList(queryWrapper);
    }

    @Override
    public Long count(QueryWrapper queryWrapper) {
        return businessMapper.selectCount(queryWrapper);
    }

    @Override
    public int save(BusinessPO poParam) {
        int insert = businessMapper.insert(poParam);
        return insert;
    }

    @Override
    public BusinessPO selectById(Integer businessId) {
        BusinessPO businessPO = businessMapper.selectById(businessId);
        return businessPO;
    }
}
